/*
 * Copyright (C) 2015 Daniel Uppenkamp
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.googlecode.maurersmarbles;

/**
 *
 * @author Daniel Uppenkamp
 */
public class TouchEvent implements InputEvent {

    /**
     * The pressed touch type.
     */
    public static final int TYPE_PRESSED = 0;
    /**
     * The released touch type.
     */
    public static final int TYPE_RELEASED = 1;

    /**
     * The x coordinate of the touch event.
     */
    protected int x;
    /**
     * The y coordinate of the touch event.
     */
    protected int y;
    /**
     * The type of touch event.
     */
    protected int type;

    /**
     * Creates a new TouchEvent.
     *
     * @param x the x coordinate of the touch event
     * @param y the y coordinate of the touch event
     * @param type the type of touch event
     */
    public TouchEvent(int x, int y, int type) {
        this.x = x;
        this.y = y;
        this.type = type;
    }

    /**
     * Returns the x, y coordinates of the touch event as a Point.
     *
     * @return the x, y coordinates of the touch event as a Point
     */
    public Point getPoint() {
        return new Point(x, y);
    }

    /**
     * Returns the x coordinate of the touch event.
     *
     * @return the x coordinate of the touch event
     */
    public int getX() {
        return x;
    }

    /**
     * Returns the y coordinate of the touch event.
     *
     * @return the y coordinate of the touch event
     */
    public int getY() {
        return y;
    }

    /**
     * Returns the type of touch event.
     *
     * @return the type of touch event
     */
    public int getType() {
        return type;
    }

}
